package org.example.demo3.demos.web.service.system;


import com.baomidou.mybatisplus.extension.service.IService;
import org.example.demo3.demos.web.common.Result;
import org.example.demo3.demos.web.entity.DefBizdict;
import org.example.demo3.demos.web.model.vo.DefBizdictVo;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 数据字典类型和类型项试图 服务类
 * </p>
 *
 * @author dlchen
 * @since 2023-11-07
 */
public interface DefBizdictService extends IService<DefBizdict> {

    /**
     * 更新dict缓存
     *
     * @return boolean
     */
    boolean updateDictCache();

    Result<List<DefBizdictVo>> getDefBIzdictByLxdm(String lxdm);

    /**
     * 通过lxdm获取k字典项编号，v字典项名称
     *
     * @param lxdm lxdm
     * @return {@link Map}<{@link String},{@link String}>
     */
    Map<String, String> getDefBIzdictNameByLxdm(String lxdm);

    /**
     * 通过类型代码获取字典Map集合，再根据key找到对应的value
     *
     * @param lxdm
     * @param key
     */
    String getDefBizDictValue(String lxdm, String key);
}
